# coding:utf-8

from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.contrib.auth.models import User
from gettext import gettext as _


class IPage(models.Model):
    name = models.CharField( _(u"Имя страницы"), max_length=150)
    title = models.CharField( _(u"Заголовок"), blank=True, default="",  max_length=50)
    teaser = models.TextField( _(u"Анонс"), blank=True, default="")
    content = models.TextField( _(u"Контент"), blank=True, default="")
    index_image = models.ImageField( _(u"Главное изображение"), blank=True, null=True, upload_to="uploads/")
    owner = models.ForeignKey(User, verbose_name=_(u"Владелец"), related_name="forms")
    create_date = models.DateField(_(u"Дата создания"), auto_now_add=True )
    modify_date = models.DateField(_(u"Дата изменения"), auto_now=True )

    def __unicode__(self):
        return self.name

    class Meta:
        verbose_name = _(u"Страница")
        verbose_name_plural = _(u"Страницы")
